; Disassembly of the file "C:\users\knoppix\My Documents\CoBra Project\Software\CPM\CPM SYSGEN 40 chr_line analysis\BLOCK#3.bin" ; ; CPU Type: Z80 ; ; Using the opcode map file "Z:\home\knoppix\CoBra Project\Software\CPM\CPM SYSGEN 40 chr_line analysis\BLOCK#3.bin.opmap" ; ; Created with dZ80 2.0 ; ; on Thursday, 12 of January 2017 at 01:58 AM ; 6E00 00 DEFB $00 6E01 00 DEFB $00 6E02 00 DEFB $00 6E03 00 DEFB $00 6E04 00 DEFB $00 6E05 00 DEFB $00 6E06 00 DEFB $00 6E07 00 DEFB $00 6E08 04 DEFB $04 6E09 00 DEFB $00 6E0A 00 DEFB $00 6E0B 00 DEFB $00 6E0C 00 DEFB $00 6E0D 00 DEFB $00 6E0E 00 DEFB $00 6E0F 00 DEFB $00 6E10 F6 DEFB $F6 6E11 FF DEFB $FF 6E12 18 DEFB $18 6E13 05 DEFB $05 6E14 AF XOR A 6E15 32046E LD ($6E04),A 6E18 4F LD C,A 6E19 21056E LD HL,$6E05 6E1C 71 LD (HL),C 6E1D 23 INC HL 6E1E 77 LD (HL),A 6E1F 215CF6 LD HL,$F65C 6E22 7E LD A,(HL) 6E23 23 INC HL 6E24 BE CP (HL) 6E25 77 LD (HL),A 6E26 2847 JR Z,$6E6F 6E28 CDD370 CALL $70D3 6E2B 215CF6 LD HL,$F65C 6E2E 4E LD C,(HL) 6E2F CB51 BIT 2,C 6E31 3E00 LD A,$00 6E33 21086E LD HL,$6E08 6E36 2006 JR NZ,$6E3E 6E38 7E LD A,(HL) 6E39 B9 CP C 6E3A 2019 JR NZ,$6E55 6E3C EE04 XOR $04 6E3E 77 LD (HL),A 6E3F 3E41 LD A,$41 6E41 81 ADD A,C 6E42 329272 LD ($7292),A 6E45 218272 LD HL,$7282 6E48 CD3B72 CALL $723B 6E4B CD76F7 CALL $F776 6E4E CD7D6E CALL $6E7D 6E51 36FF LD (HL),$FF 6E53 181A JR $6E6F 6E55 21F8FD LD HL,$FDF8 6E58 4E LD C,(HL) 6E59 CB91 RES 2,C 6E5B 3A51F6 LD A,($F651) 6E5E 77 LD (HL),A 6E5F 23 INC HL 6E60 46 LD B,(HL) 6E61 110CFC LD DE,$FC0C 6E64 69 LD L,C 6E65 2600 LD H,$00 6E67 19 ADD HL,DE 6E68 70 LD (HL),B 6E69 B3 OR E 6E6A 6F LD L,A 6E6B 7E LD A,(HL) 6E6C 32F9FD LD ($FDF9),A 6E6F CDAE6F CALL $6FAE 6E72 FEC0 CP $C0 6E74 381C JR C,$6E92 6E76 CD806E CALL $6E80 6E79 36FF LD (HL),$FF 6E7B 18F2 JR $6E6F 6E7D 3A51F6 LD A,($F651) 6E80 E603 AND $03 6E82 2108FC LD HL,$FC08 6E85 B5 OR L 6E86 6F LD L,A 6E87 7E LD A,(HL) 6E88 C9 RET 6E89 3D DEC A 6E8A CD906F CALL $6F90 6E8D CD4E70 CALL $704E 6E90 1821 JR $6EB3 6E92 CDCB6F CALL $6FCB 6E95 CD806E CALL $6E80 6E98 2156F6 LD HL,$F656 6E9B BE CP (HL) 6E9C 2820 JR Z,$6EBE 6E9E 3C INC A 6E9F 20E8 JR NZ,$6E89 6EA1 32036E LD ($6E03),A 6EA4 2151F6 LD HL,$F651 6EA7 CB4E BIT 1,(HL) 6EA9 2802 JR Z,$6EAD 6EAB F640 OR $40 6EAD CD906F CALL $6F90 6EB0 CD3070 CALL $7030 6EB3 B7 OR A 6EB4 C2D871 JP NZ,$71D8 6EB7 CD7D6E CALL $6E7D 6EBA 3A56F6 LD A,($F656) 6EBD 77 LD (HL),A 6EBE 3A51F6 LD A,($F651) 6EC1 CB4F BIT 1,A 6EC3 200F JR NZ,$6ED4 6EC5 CDD370 CALL $70D3 6EC8 CDE66F CALL $6FE6 6ECB AF XOR A 6ECC 3255F6 LD ($F655),A 6ECF 3A066E LD A,($6E06) 6ED2 1836 JR $6F0A 6ED4 AF XOR A 6ED5 21066E LD HL,$6E06 6ED8 BE CP (HL) 6ED9 2B DEC HL 6EDA 2B DEC HL 6EDB 2815 JR Z,$6EF2 6EDD 23 INC HL 6EDE 7E LD A,(HL) 6EDF FE02 CP $02 6EE1 2B DEC HL 6EE2 7E LD A,(HL) 6EE3 2009 JR NZ,$6EEE 6EE5 ED5B59F6 LD DE,($F659) 6EE9 13 INC DE 6EEA 13 INC DE 6EEB 13 INC DE 6EEC 1A LD A,(DE) 6EED 3C INC A 6EEE B7 OR A 6EEF 2801 JR Z,$6EF2 6EF1 35 DEC (HL) 6EF2 1155F6 LD DE,$F655 6EF5 0604 LD B,$04 6EF7 1B DEC DE 6EF8 2B DEC HL 6EF9 1A LD A,(DE) 6EFA BE CP (HL) 6EFB 2004 JR NZ,$6F01 6EFD 10F8 DJNZ $6EF7 6EFF 181B JR $6F1C 6F01 CDD370 CALL $70D3 6F04 CDE66F CALL $6FE6 6F07 3A046E LD A,($6E04) 6F0A B7 OR A 6F0B CCEC70 CALL Z,$70EC 6F0E 2AF8FD LD HL,($FDF8) 6F11 CB95 RES 2,L 6F13 22006E LD ($6E00),HL 6F16 2AFAFD LD HL,($FDFA) 6F19 22026E LD ($6E02),HL 6F1C 2100FF LD HL,$FF00 6F1F 3A55F6 LD A,($F655) 6F22 1F RRA 6F23 CB1D RR L 6F25 1F RRA 6F26 CB14 RL H 6F28 ED5B57F6 LD DE,($F657) 6F2C 018000 LD BC,$0080 6F2F 3A066E LD A,($6E06) 6F32 B7 OR A 6F33 2804 JR Z,$6F39 6F35 EB EX DE,HL 6F36 32076E LD ($6E07),A 6F39 CD9AF9 CALL $F99A 6F3C 3A056E LD A,($6E05) 6F3F FE01 CP $01 6F41 78 LD A,B 6F42 C0 RET NZ 6F43 CDD370 CALL $70D3 6F46 C9 RET ; ########### 8272_POLL ############ ; determines direction of I/O for 8272 6F47 DBF5 IN A,($F5) ; read 8272 Status Register <--- <--- <--- <--- <--- <--- <---| 6F49 CB7F BIT 7,A ; test RQM (if 8272 Data Register ready to send or receive) | 6F4B 28FA JR Z,$6F47 ; if not ready, repeat loop ---> ---> ---> ---> ---> ---> --->| 6F4D CB77 BIT 6,A ; test DIO (Direction of 8272 I/O) 6F4F C9 RET ; return with DIO as the Z flag in Z80 6F50 21ADF9 LD HL,$F9AD 6F53 E5 PUSH HL 6F54 320A6E LD ($6E0A),A 6F57 21F8FD LD HL,$FDF8 ; addr of command arg#1 = $00 meaning drive 0 ; ########## 8272_CMD ############# ; send a command to 8272 ; inputs: HL=start addr of bytes to be sent (command args after opcode) ; C=first byte to be sent (command opcode) ; B=nr of command bytes (opcode+args) 6F5A DBF5 IN A,($F5) ; read 8272 Status Register <--- <--- <--- <----| 6F5C E610 AND $10 ; test bit 4 (FDC Busy) | 6F5E 2804 JR Z,$6F64 ; if FDC not Busy -> ---> --->| | 6F60 18F8 JR $6F5A ; if FDC Busy=1 repeat loop ----> ---> ---> --->| 6F62 4E LD C,(HL) ; read next 8272 cmd byte <--- <--- <---| 6F63 23 INC HL ; increment cmd byte pointer | | 6F64 F3 DI ; <--- <--- <--- <--- <--- <--| | 6F65 CD476F CALL $6F47 ; call 8272_POLL to determine direction of I/O for 8272 6F68 C2DD71 JP NZ,$71DD; if I/O from 8272 to CPU jump to ... | 6F6B 59 LD E,C ; if I/O from CPU to 8272 continue | first byte (8272 opcode) is in C before calling this routine 6F6C 0EFD LD C,$FD ; (addr of 8272 Data Register) | 6F6E ED59 OUT (C),E ; ...send contents of E to 8272 Data Register 6F70 10F0 DJNZ $6F62 ; --> ---> ---> ---> ---> ---> ---> --->| nr of loops = contents of B 6F72 FB EI 6F73 C9 RET ; ########### 8272_RD ############# ; reads last command result bytes from 8272 ; outputs: A=first result byte ; (FDF0-FDF6)=the max. 7 result bytes in order 6F74 21F0FD LD HL,$FDF0 ; start address to store 8272 command result bytes 6F77 0608 LD B,$08 ; counter (8 bytes to read from 8272) 6F79 CD476F CALL $6F47 ; call 8272_POLL <--- <--- <--- <--- <--| 6F7C 280D JR Z,$6F8B ; if I/O from CPU to 8272 jump >| | 6F7E 36FF LD (HL),$FF ; ($FDF0)=$FF | | 6F80 36FF LD (HL),$FF ; ($FDF0)=$FF (again!?) | | 6F82 DBFD IN A,($FD) ; read 8272 Data Register | | 6F84 77 LD (HL),A ; store result | | 6F85 23 INC HL ; increment storage pointer | | 6F86 10F1 DJNZ $6F79 ; --> ---> ---> ---> ---> ---> ---> --->| 6F88 C3DD71 JP $71DD ; | ; | 6F8B 21F0FD LD HL,$FDF0 ; <--- <--- <--- <--- <--- <---| 6F8E 7E LD A,(HL) ; return with first result byte in A 6F8F C9 RET ; ########### CALLED FROM $70C1 ############# 6F90 3256F6 LD ($F656),A ; $00 if drv#=0 or 1, $40 if drv#=2 or 3 6F93 2A59F6 LD HL,($F659) ; HL = $F6EA (if drv# = 0 or 1) or $F6CA (if drv# = 2 or 3) 6F96 110800 LD DE,$0008 6F99 B7 OR A 6F9A ED52 SBC HL,DE ; HL = $F6E2 (if drv# = 0 or 1) or $F6C2 (if drv# = 2 or 3) 6F9C EB EX DE,HL ; DE = $F6E2 (if drv# = 0 or 1) or $F6C2 (if drv# = 2 or 3) 6F9D 21F8FD LD HL,$FDF8 ; HL = addr of 8272 arg#1 (head+drive) 6FA0 CB96 RES 2,(HL) ; set head#=0 6FA2 010400 LD BC,$0004 6FA5 09 ADD HL,BC ; HL = addr of 8272 arg#5 (N) 6FA6 EB EX DE,HL ; DE = addr of 8272 arg#5 (N), HL = $F6E2 (if drv# = 0 or 1) or $F6C2 (if drv# = 2 or 3) 6FA7 EDB0 LDIR ; copy 4 bytes from $F6E2/$F6C2 to $FDFC, when done HL = $F6E6/$F6C6 6FA9 010303 LD BC,$0303 ; B = $03 for 3 command bytes, C = $03 opcode for 8272 Specify command 6FAC 18AC JR $6F5A ; send Specify command to 8272 with args at $F6E6/$F6C6 6FAE 010801 LD BC,$0108 ; B=$01 for 1 command byte (opcode), C=$08 for Sense Interrupt Status opcode 6FB1 CD5A6F CALL $6F5A ; call 8272_CMD to send a Sense Interrupt Status command to 8272 6FB4 18BE JR $6F74 ; call 8272_RD to read command results (returns ST0 in A) 6FB6 CDAE6F CALL $6FAE ; send a Sense Interrupt Status command to 8272 <--- <----| this loop puts ; and get first result byte (ST0) in A | 8272 in standby 6FB9 FE80 CP $80 ; check if Invalid Command Issue | and ready to receive 6FBB C8 RET Z ; return if Invalid Command Issue | new commands 6FBC 18F8 JR $6FB6 ; repeat ---> ---> ---> ---> ---> ---> ---> ---> ---> --->| ; ########### PART OF BIOS BOOT ############ 6FBE 010402 LD BC,$0204 ; B=$02 for 2 loops (2-byte command), C=$04 for 8272 Sense Drive Status command 6FC1 AF XOR A ; A = $00 6FC2 CD546F CALL $6F54 ; call 8272_CMD to store ($6E0A)=$00, then send a Sense Drive Status command (arg at ($FDF8)) 6FC5 CD746F CALL $6F74 ; call 8272_RD to read & store command result bytes at (FDF0-FDF6) 6FC8 CB6F BIT 5,A ; test bit 5 of first result byte (bit 5 of ST3 = RDY) 6FCA C9 RET 6FCB CDBE6F CALL $6FBE 6FCE C0 RET NZ 6FCF CDD371 CALL $71D3 6FD2 CDBE6F CALL $6FBE 6FD5 C0 RET NZ 6FD6 CD13F7 CALL $F713 6FD9 B7 OR A 6FDA 28F6 JR Z,$6FD2 6FDC CD76F7 CALL $F776 6FDF AF XOR A 6FE0 320400 LD ($0004),A 6FE3 C303F6 JP $F603 6FE6 2A53F6 LD HL,($F653) 6FE9 22FAFD LD ($FDFA),HL 6FEC 7D LD A,L 6FED 2AF8FD LD HL,($FDF8) 6FF0 CB95 RES 2,L 6FF2 B7 OR A 6FF3 2802 JR Z,$6FF7 6FF5 CBD5 SET 2,L 6FF7 3A52F6 LD A,($F652) 6FFA BC CP H 6FFB 67 LD H,A 6FFC 22F8FD LD ($FDF8),HL 6FFF C8 RET Z 7000 B7 OR A 7001 282D JR Z,$7030 7003 3A5CF6 LD A,($F65C) 7006 FE06 CP $06 7008 3805 JR C,$700F 700A 21F9FD LD HL,$FDF9 700D CB26 SLA (HL) 700F 010F03 LD BC,$030F 7012 3E01 LD A,$01 7014 CD546F CALL $6F54 7017 3A52F6 LD A,($F652) 701A 32F9FD LD ($FDF9),A ; ------------- called from $704B -------------- 701D CDAE6F CALL $6FAE ; Send a SIS to 8272 (returns ST0 in A) <--- <---- <----| 7020 CB6F BIT 5,A ; test bit 5 of ST0 (1 if seek ended) | 7022 28F9 JR Z,$701D ; if seek not finished, jump ------> ---> ---> ---> --->| 7024 E650 AND $50 ; keep bits 6, 4 7026 C2E271 JP NZ,$71E2 ; jump if errors 7029 DBF5 IN A,($F5) ; Read 8272 Status Register <--- <--- <--- <--- <--- <--| 702B E60F AND $0F ; keep bits 0-4 | 702D C8 RET Z ; if no drive is in Seek mode, return | 702E 18F9 JR $7029 ; ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> --->| 7030 3A51F6 LD A,($F651) 7033 CB4F BIT 1,A 7035 2808 JR Z,$703F 7037 3E02 LD A,$02 7039 32F9FD LD ($FDF9),A 703C CD0F70 CALL $700F 703F AF XOR A ; ------------- called from $70C4 -------------- 7040 32F9FD LD ($FDF9),A ; 8272 arg#2, C | N = 0 7043 010702 LD BC,$0207 ; 2 cmd bytes for 8272, C=$07 opcode for Recalibrate 7046 F602 OR $02 ; A = $02 7048 CD546F CALL $6F54 ; Send Recalibrate command with args at $FDF8 704B CD1D70 CALL $701D ; Send SIS command and make sure Seek ended 704E 0603 LD B,$03 ; 3 loops next 7050 C5 PUSH BC ; <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <---| 7051 3A56F6 LD A,($F656) ; $00 if drv#=0 or 1, $40 if drv#=2 or 3 | 7054 F60A OR $0A ; A = $0A if drv#=0 or 1, $4A if drv#=2 or 3 | 7056 4F LD C,A ; C = $0A if drv#=0 or 1 (opcode for FM Read ID), $4A if drv#=2 or 3 (opcode for MFM Read ID) 7057 0602 LD B,$02 ; 2-byte command for 8272 | 7059 3E03 LD A,$03 ; | 705B CD546F CALL $6F54 ; call 8272_CMD to send Read ID with args at $FDF8 | 705E CD746F CALL $6F74 ; call 8272_RD to read cmd results (A=first result byte, ST0) 7061 E6C0 AND $C0 ; keep bits 6,7 of ST0 | 7063 C1 POP BC ; | 7064 2802 JR Z,$7068 ; if command terminated OK, skip 1 line ---> -->| | 7066 10E8 DJNZ $7050 ; ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> --->| 7068 CBD5 SET 2,L ; <--- <--- <--- <--- <--- <--- <--- <--- <-----| <<< at this point HL=$FDF0 (set at end of 8272_RD called 5 lines above) 706A 23 INC HL ; HL = $FDF5 706B 46 LD B,(HL) ; B = sector number at Read ID 706C 23 INC HL ; HL = $FDF6 706D 4E LD C,(HL) ; C = N (bytes/sector) 706E 23 INC HL ; HL = $FDF7 ($FDF7 is not used for result bytes) 706F 70 LD (HL),B ; ($FDF7) = sector number at Read ID 7070 C9 RET ; ########### CONTINUED FROM BIOS BOOT ############ ; FC00 to FC03 represent logical drives A: to D:. ; They initially contain values 0 ... 3 representing corresponding physical drv numbers. ; That means initially drive 0 is drive A, drive 1 is drive B etc. 7071 2100FC LD HL,$FC00 ; <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <-| 7074 54 LD D,H ; | 7075 5D LD E,L ; DE = $FC00 | 7076 0604 LD B,$04 ; 4 loops next, for 4 drive numbers stored at $FC00-$FC03 (0, 1, 2, 3) | 7078 7E LD A,(HL) ; A = ($FC00) = physical number for drive A: <--- <--- <--- <---| | 7079 32F8FD LD ($FDF8),A ; ($FDF8) = physical number of drive found READY | | 707C D9 EXX ; | | 707D CDBE6F CALL $6FBE ; send a Sense Drive Status command to drive number at $FDF8 and test if READY | 7080 D9 EXX ; | | 7081 2005 JR NZ,$7088 ; If drive READY jump -> ---> ---> --->| | | 7083 23 INC HL ; if not, increment drv# pointer | | | 7084 10F2 DJNZ $7078 ; and repeat loop -----> ---> ---> ---> ---> ---> ---> ---> --->| | 7086 18E9 JR $7071 ; --> ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> --->| 7088 7E LD A,(HL) ; <--- <--- <--- <--- <--- <--- <--- <--| A = physical drv# found ready 7089 3600 LD (HL),$00 ; change physical drv# for logical drv found ready to 0 708B 12 LD (DE),A ; change physical drv# for logical drv 0 (drive A: at $FC00) from 0 to drv# found ready 708C 210400 LD HL,$0004 708F 19 ADD HL,DE ; HL = $FC04 = address of logical drive E: 7090 77 LD (HL),A ; set physical number for logical drive E: to physical drv# found ready 7091 23 INC HL ; HL = $FC05 = address of logical drive F: 7092 77 LD (HL),A ; set physical number for logical drive F: to physical drv# found ready 7093 5D LD E,L ; DE = $FC05 = address of logical drive F: 7094 23 INC HL ; HL = $FC06 = address of logical drive G: 7095 77 LD (HL),A ; set physical number for logical drive G: to physical drv# found ready 7096 23 INC HL ; HL = $FC07 = address of logical drive H: 7097 56 LD D,(HL) ; D = physical drv# of logical drive H:, E = $05 7098 77 LD (HL),A ; set physical number for logical drive H: to physical drv# found ready 7099 C9 RET ; this will make a jump to $7230 (see line FE55 in BIOS BOOT where we came from) ; where the CP/M startup message will be printed ; ############# EXECUTED AFTER PRINTING STARTUP MESSAGE ############## 709A FB EI 709B 3AF8FD LD A,($FDF8) ; 8272 cmd arg#1: head+drive 709E E603 AND $03 ; keep only the drive bits 70A0 F630 OR $30 ; add to '0' char code 70A2 329D72 LD ($729D),A ; save instead of '0' in "Insert disk E in drive 0" 70A5 CB4F BIT 1,A ; test if drv# = 2 or 3 70A7 3E00 LD A,$00 70A9 21EAF6 LD HL,$F6EA 70AC 2805 JR Z,$70B3 ; if drv# = 0 or 1 jump ----> ---> --->| 70AE F640 OR $40 ; A = $40 | 70B0 21CAF6 LD HL,$F6CA ; | 70B3 2259F6 LD ($F659),HL ; <--- <--- <--- <--- <--- <--- <----| ; ($F659_$F65A) = $F6EA (if drv# = 0 or 1), ($F659_$F65A) = $F6CA (if drv# = 2 or 3) 70B6 224AFB LD ($FB4A),HL ; ($FB4A_$FB4B) = $F6EA (if drv# = 0 or 1), ($FB4A_$FB4B) = $F6CA (if drv# = 2 or 3) 70B9 2B DEC HL 70BA 56 LD D,(HL) 70BB 2B DEC HL 70BC 5E LD E,(HL) ; DE = ($F6E8_$F6E9) if drv# = 0 or 1, DE = ($F6C8_$F6C9) if drv# = 2 or 3 70BD ED5340FB LD ($FB40),DE ; ($FB40_$FB41) = ($F6E8_$F6E9) if drv# = 0 or 1, or ($F6C8_$F6C9) if drv# = 2 or 3 70C1 CD906F CALL $6F90 ; send Specify command to 8272 with args at $F6E6/$F6C6 70C4 CD3F70 CALL $703F ; Send Read ID on track 0 and get results at $FDF0-$FDF6 70C7 C5 PUSH BC ; BC = RN at Read ID @@@@@@@@@@@@@ CP/M PROTECTION CODE @@@@@@@@@@@@@ 70C8 F3 DI 70C9 D9 EXX ; ### this pairs up with EXX at $7230 previously executed ### 70CA E1 POP HL ; HL = RN at Read ID @@@@@@@@@@@@@ CP/M PROTECTION CODE @@@@@@@@@@@@@ 70CB B7 OR A ; A = $00 if no errors from Read ID 70CC ED52 SBC HL,DE ; compare CP/M PROTECTION CODE with DE 70CE C8 RET Z ; RET if identical, to $F603 (pushed on stack at $FE53 in BIOS BOOT) @@@@@@@@@@@@@ change this opcode ($C8) to $C9 to remove protection 70CF E1 POP HL ; HL = $F603 (pushed on stack at $FE53 in BIOS BOOT) 70D0 2E00 LD L,$00 ; HL = $F600 (address of BIOS BOOT in BIOS function jump table, but that JP instruction was changed to JP CPM_TO_COBRA) 70D2 E9 JP (HL) ; jump to CPM_TO_COBRA, back to BOOT ROM 70D3 21076E LD HL,$6E07 70D6 F6FF OR $FF 70D8 AE XOR (HL) 70D9 C0 RET NZ 70DA 77 LD (HL),A 70DB F6FF OR $FF 70DD 32096E LD ($6E09),A 70E0 3A56F6 LD A,($F656) 70E3 F605 OR $05 70E5 2186F9 LD HL,$F986 70E8 CBC6 SET 0,(HL) 70EA 1811 JR $70FD 70EC AF XOR A 70ED 32036E LD ($6E03),A 70F0 32096E LD ($6E09),A 70F3 3A56F6 LD A,($F656) 70F6 F606 OR $06 70F8 2186F9 LD HL,$F986 70FB CB86 RES 0,(HL) 70FD 4F LD C,A 70FE E607 AND $07 7100 320A6E LD ($6E0A),A 7103 060A LD B,$0A 7105 C5 PUSH BC 7106 CD5871 CALL $7158 7109 AF XOR A 710A 325BF6 LD ($F65B),A 710D CD39F6 CALL $F639 7110 2185F9 LD HL,$F985 7113 2298FD LD ($FD98),HL 7116 218AF9 LD HL,$F98A 7119 229CFD LD ($FD9C),HL 711C 0609 LD B,$09 711E 3A0A6E LD A,($6E0A) 7121 CD506F CALL $6F50 7124 2187F9 LD HL,$F987 7127 2298FD LD ($FD98),HL 712A 229CFD LD ($FD9C),HL 712D CD5871 CALL $7158 7130 F6FF OR $FF 7132 CD39F6 CALL $F639 7135 CD746F CALL $6F74 7138 C1 POP BC 7139 3A5BF6 LD A,($F65B) 713C B7 OR A 713D 283D JR Z,$717C 713F 7E LD A,(HL) 7140 23 INC HL 7141 E6D8 AND $D8 7143 2037 JR NZ,$717C 7145 23 INC HL 7146 7E LD A,(HL) 7147 CBB7 RES 6,A 7149 2B DEC HL 714A B6 OR (HL) 714B 202F JR NZ,$717C 714D 3A096E LD A,($6E09) 7150 B7 OR A 7151 C8 RET Z 7152 0600 LD B,$00 7154 10FE DJNZ $7154 7156 78 LD A,B 7157 C9 RET 7158 F3 DI 7159 3EFF LD A,$FF 715B D3E3 OUT ($E3),A 715D 3E01 LD A,$01 715F D3E3 OUT ($E3),A 7161 3E7F LD A,$7F 7163 D3EB OUT ($EB),A 7165 3A56F6 LD A,($F656) 7168 EE40 XOR $40 716A D3EB OUT ($EB),A 716C 3EFF LD A,$FF 716E D3F3 OUT ($F3),A 7170 3E02 LD A,$02 7172 D3F3 OUT ($F3),A 7174 C9 RET 7175 C5 PUSH BC 7176 CDB468 CALL $68B4 7179 C1 POP BC 717A 1889 JR $7105 717C 10F7 DJNZ $7175 717E D1 POP DE 717F CB66 BIT 4,(HL) 7181 11FE72 LD DE,$72FE 7184 2063 JR NZ,$71E9 7186 CB7E BIT 7,(HL) 7188 110E73 LD DE,$730E 718B 205C JR NZ,$71E9 718D CB4E BIT 1,(HL) 718F 110673 LD DE,$7306 7192 2055 JR NZ,$71E9 7194 CB46 BIT 0,(HL) 7196 111B73 LD DE,$731B 7199 013673 LD BC,$7336 719C 2013 JR NZ,$71B1 719E CB6E BIT 5,(HL) 71A0 112873 LD DE,$7328 71A3 2016 JR NZ,$71BB 71A5 CB56 BIT 2,(HL) 71A7 112C73 LD DE,$732C 71AA 2016 JR NZ,$71C2 71AC 11F572 LD DE,$72F5 71AF 1838 JR $71E9 71B1 23 INC HL 71B2 CB46 BIT 0,(HL) 71B4 2836 JR Z,$71EC 71B6 014373 LD BC,$7343 71B9 1831 JR $71EC 71BB 23 INC HL 71BC CB6E BIT 5,(HL) 71BE 282C JR Z,$71EC 71C0 18F4 JR $71B6 71C2 23 INC HL 71C3 CB6E BIT 5,(HL) 71C5 015273 LD BC,$7352 71C8 2022 JR NZ,$71EC 71CA CB4E BIT 1,(HL) 71CC 015F73 LD BC,$735F 71CF 201B JR NZ,$71EC 71D1 1816 JR $71E9 71D3 11DD72 LD DE,$72DD 71D6 1811 JR $71E9 71D8 11ED72 LD DE,$72ED 71DB 180C JR $71E9 71DD 11D572 LD DE,$72D5 71E0 1803 JR $71E5 71E2 11D972 LD DE,$72D9 71E5 0103F6 LD BC,$F603 71E8 C5 PUSH BC 71E9 010000 LD BC,$0000 71EC C5 PUSH BC 71ED D5 PUSH DE 71EE 3E30 LD A,$30 71F0 21F8FD LD HL,$FDF8 71F3 B6 OR (HL) 71F4 CB97 RES 2,A 71F6 117472 LD DE,$7274 71F9 12 LD (DE),A 71FA 13 INC DE 71FB CD4772 CALL $7247 71FE 13 INC DE 71FF 13 INC DE 7200 23 INC HL 7201 3E30 LD A,$30 7203 B6 OR (HL) 7204 12 LD (DE),A 7205 CD4772 CALL $7247 7208 216672 LD HL,$7266 720B CD3B72 CALL $723B 720E 57 LD D,A 720F 3A0A6E LD A,($6E0A) 7212 87 ADD A,A 7213 5F LD E,A 7214 21A372 LD HL,$72A3 7217 19 ADD HL,DE 7218 5E LD E,(HL) 7219 23 INC HL 721A 56 LD D,(HL) 721B EB EX DE,HL 721C CD3B72 CALL $723B 721F CD3872 CALL $7238 7222 E1 POP HL 7223 CD3B72 CALL $723B 7226 E1 POP HL 7227 B4 OR H 7228 C43B72 CALL NZ,$723B 722B CD3872 CALL $7238 722E 3C INC A 722F C9 RET 7230 D9 EXX ; jumped from $7071 7231 2100FE LD HL,$FE00 ; addr of startup message 7234 CD3B72 CALL $723B ; Print null terminated startup message stored at $FE00 7237 E9 JP (HL) ; HL = $FE29 (after printing startup message) where a NOP ($00) is. ; After that there is a JP $709A so execution continues at $709A. ; ############## PRINT A NULL TERMINATED MESSAGE ############## 7238 21A072 LD HL,$72A0 ; ------------- stored at $72A0 -------------- 723B 7E LD A,(HL) ; -------------- or stored at (HL) ------------ <--- <--- <--- <--- <--- <--- <-| 723C B7 OR A ; A = A || ($72A0) if called at $7238, A = A || (HL) if called at $723B | 723D C8 RET Z ; | 723E 4F LD C,A ; C = $1B | 723F E5 PUSH HL ; save $FE00 on stack | 7240 CD85F7 CALL $F785 ; call BIOS CONOUT (04 - Write Console Char Out) with char to write in C | 7243 E1 POP HL ; HL = $FE00 | 7244 23 INC HL ; HL = $FE01 | 7245 18F4 JR $723B ; --> ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> --->| 7247 3E30 LD A,$30 7249 4F LD C,A 724A 13 INC DE 724B 13 INC DE 724C 23 INC HL 724D 46 LD B,(HL) 724E 04 INC B 724F 3D DEC A 7250 3C INC A 7251 FE3A CP $3A 7253 3803 JR C,$7258 7255 E630 AND $30 7257 0C INC C 7258 10F6 DJNZ $7250 725A EB EX DE,HL 725B 71 LD (HL),C 725C 23 INC HL 725D 77 LD (HL),A 725E EB EX DE,HL 725F C9 RET 7260 F9 DEFB $F9 7261 16 DEFB $16 7262 00 DEFB $00 7263 00 DEFB $00 7264 00 DEFB $00 7265 1A DEFB $1A 7266 07 DEFB $07 7267 0D DEFB $0D 7268 0A DEFB $0A 7269 0E DEFB $0E ; inverse video 726A 20 DEFB $20 ; ' ' 726B 45 DEFB $45 ; 'E' 726C 72 DEFB $72 ; 'r' 726D 72 DEFB $72 ; 'r' 726E 6F DEFB $6F ; 'o' 726F 72 DEFB $72 ; 'r' 7270 20 DEFB $20 ; ' ' 7271 6F DEFB $6F ; 'o' 7272 6E DEFB $6E ; 'n' 7273 20 DEFB $20 ; ' ' 7274 30 DEFB $30 ; '0' 7275 3A DEFB $3A ; ':' 7276 7C DEFB $7C ; '|' 7277 30 DEFB $30 ; '0' 7278 30 DEFB $30 ; '0' 7279 7C DEFB $7C ; '|' 727A 30 DEFB $30 ; '0' 727B 7C DEFB $7C ; '|' 727C 30 DEFB $30 ; '0' 727D 30 DEFB $30 ; '0' 727E 7C DEFB $7C ; '| 727F 0F DEFB $0F ; normal video 7280 20 DEFB $20 ; ' ' 7281 00 DEFB $00 7282 0D DEFB $0D ; <CR> 7283 0A DEFB $0A ; <LF> 7284 0E DEFB $0E ; inverse video 7285 20 DEFB $20 ; ' ' 7286 49 DEFB $49 ; 'I' 7287 6E DEFB $6E ; 'n' 7288 73 DEFB $73 ; 's' 7289 65 DEFB $65 ; 'e' 728A 72 DEFB $72 ; 'r' 728B 74 DEFB $74 ; 't' 728C 20 DEFB $20 ; ' ' 728D 64 DEFB $64 ; 'd' 728E 69 DEFB $69 ; 'i' 728F 73 DEFB $73 ; 's' 7290 6B DEFB $6B ; 'k' 7291 20 DEFB $20 ; ' ' 7292 45 DEFB $45 ; 'E' 7293 20 DEFB $20 ; ' ' 7294 69 DEFB $69 ; 'i' 7295 6E DEFB $6E ; 'n' 7296 20 DEFB $20 ; ' ' 7297 64 DEFB $64 ; 'd' 7298 72 DEFB $72 ; 'r' 7299 69 DEFB $69 ; 'i' 729A 76 DEFB $76 ; 'v' 729B 65 DEFB $65 ; 'e' 729C 20 DEFB $20 ; ' ' 729D 30 DEFB $30 ; '0' 729E 3A DEFB $3A ; ':' 729F 0F DEFB $0F ; normal video 72A0 0D DEFB $0D ; <CR> 72A1 0A DEFB $0A ; <LF> 72A2 00 DEFB $00 72A3 A2 DEFB $A2 72A4 72 DEFB $72 72A5 B1 DEFB $B1 72A6 72 DEFB $72 72A7 B6 DEFB $B6 72A8 72 DEFB $72 72A9 C2 DEFB $C2 72AA 72 DEFB $72 72AB A2 DEFB $A2 72AC 72 DEFB $72 72AD CA DEFB $CA 72AE 72 DEFB $72 72AF D0 DEFB $D0 72B0 72 DEFB $72 72B1 73 DEFB $73 ; 's' 72B2 65 DEFB $65 ; 'e' 72B3 65 DEFB $65 ; 'e' 72B4 6B DEFB $6B ; 'k' 72B5 00 DEFB $00 72B6 72 DEFB $72 ; 'r' 72B7 65 DEFB $65 ; 'e' 72B8 63 DEFB $63 ; 'c' 72B9 61 DEFB $61 ; 'a' 72BA 6C DEFB $6C ; 'l' 72BB 69 DEFB $69 ; 'i' 72BC 62 DEFB $62 ; 'b' 72BD 72 DEFB $72 ; 'r' 72BE 61 DEFB $61 ; 'a' 72BF 74 DEFB $74 ; 't' 72C0 65 DEFB $65 ; 'e' 72C1 00 DEFB $00 72C2 72 DEFB $72 ; 'r' 72C3 65 DEFB $65 ; 'e' 72C4 61 DEFB $61 ; 'a' 72C5 64 DEFB $64 ; 'd' 72C6 20 DEFB $20 ; ' ' 72C7 69 DEFB $69 ; 'i' 72C8 64 DEFB $64 ; 'd' 72C9 00 DEFB $00 72CA 77 DEFB $77 ; 'w' 72CB 72 DEFB $72 ; 'r' 72CC 69 DEFB $69 ; 'i' 72CD 74 DEFB $74 ; 't' 72CE 65 DEFB $65 ; 'e' 72CF 00 DEFB $00 72D0 72 DEFB $72 ; 'r' 72D1 65 DEFB $65 ; 'e' 72D2 61 DEFB $61 ; 'a' 72D3 64 DEFB $64 ; 'd' 72D4 00 DEFB $00 72D5 66 DEFB $66 ; 'f' 72D6 64 DEFB $64 ; 'd' 72D7 63 DEFB $63 ; 'c' 72D8 00 DEFB $00 72D9 66 DEFB $66 ; 'f' 72DA 64 DEFB $64 ; 'd' 72DB 64 DEFB $64 ; 'd' 72DC 00 DEFB $00 72DD 64 DEFB $64 ; 'd' 72DE 72 DEFB $72 ; 'r' 72DF 69 DEFB $69 ; 'i' 72E0 76 DEFB $76 ; 'v' 72E1 65 DEFB $65 ; 'e' 72E2 20 DEFB $20 ; ' ' 72E3 6E DEFB $6E ; 'n' 72E4 6F DEFB $6F ; 'o' 72E5 74 DEFB $74 ; 't' 72E6 20 DEFB $20 ; ' ' 72E7 72 DEFB $72 ; 'r' 72E8 65 DEFB $65 ; 'e' 72E9 61 DEFB $61 ; 'a' 72EA 64 DEFB $64 ; 'd' 72EB 79 DEFB $79 ; 'y' 72EC 00 DEFB $00 72ED 64 DEFB $64 ; 'd' 72EE 65 DEFB $65 ; 'e' 72EF 6E DEFB $6E ; 'n' 72F0 73 DEFB $73 ; 's' 72F1 69 DEFB $69 ; 'i' 72F2 74 DEFB $74 ; 't' 72F3 79 DEFB $79 ; 'y' 72F4 00 DEFB $00 72F5 61 DEFB $61 ; 'a' 72F6 62 DEFB $62 ; 'b' 72F7 6E DEFB $6E ; 'n' 72F8 6F DEFB $6F ; 'o' 72F9 72 DEFB $72 ; 'r' 72FA 6D DEFB $6D ; 'm' 72FB 61 DEFB $61 ; 'a' 72FC 6C DEFB $6C ; 'l' 72FD 00 DEFB $00 72FE 6F DEFB $6F ; 'o' 72FF 76 DEFB $76 ; 'v' 7300 65 DEFB $65 ; 'e' 7301 72 DEFB $72 ; 'r' 7302 72 DEFB $72 ; 'r' 7303 75 DEFB $75 ; 'u' 7304 6E DEFB $6E ; 'n' 7305 00 DEFB $00 7306 70 DEFB $70 ; 'p' 7307 72 DEFB $72 ; 'r' 7308 6F DEFB $6F ; 'o' 7309 74 DEFB $74 ; 't' 730A 65 DEFB $65 ; 'e' 730B 63 DEFB $63 ; 'c' 730C 74 DEFB $74 ; 't' 730D 00 DEFB $00 730E 65 DEFB $65 ; 'e' 730F 6E DEFB $6E ; 'n' 7310 64 DEFB $64 ; 'd' 7311 20 DEFB $20 ; ' ' 7312 6F DEFB $6F ; 'o' 7313 66 DEFB $66 ; 'f' 7314 20 DEFB $20 ; ' ' 7315 74 DEFB $74 ; 't' 7316 72 DEFB $72 ; 'r' 7317 61 DEFB $61 ; 'a' 7318 63 DEFB $63 ; 'c' 7319 6B DEFB $6B ; 'k' 731A 00 DEFB $00 731B 61 DEFB $61 ; 'a' 731C 64 DEFB $64 ; 'd' 731D 64 DEFB $64 ; 'd' 731E 72 DEFB $72 ; 'r' 731F 65 DEFB $65 ; 'e' 7320 73 DEFB $73 ; 's' 7321 73 DEFB $73 ; 's' 7322 20 DEFB $20 ; ' ' 7323 6D DEFB $6D ; 'm' 7324 61 DEFB $61 ; 'a' 7325 72 DEFB $72 ; 'r' 7326 6B DEFB $6B ; 'k' 7327 00 DEFB $00 7328 63 DEFB $63 ; 'c' 7329 72 DEFB $72 ; 'r' 732A 63 DEFB $63 ; 'c' 732B 00 DEFB $00 732C 6E DEFB $6E ; 'n' 732D 6F DEFB $6F ; 'o' 732E 74 DEFB $74 ; 't' 732F 20 DEFB $20 ; ' ' 7330 66 DEFB $66 ; 'f' 7331 6F DEFB $6F ; 'o' 7332 75 DEFB $75 ; 'u' 7333 6E DEFB $6E ; 'n' 7334 64 DEFB $64 ; 'd' 7335 00 DEFB $00 7336 20 DEFB $20 ; ' ' 7337 69 DEFB $69 ; 'i' 7338 6E DEFB $6E ; 'n' 7339 20 DEFB $20 ; ' ' 733A 69 DEFB $69 ; 'i' 733B 64 DEFB $64 ; 'd' 733C 20 DEFB $20 ; ' ' 733D 66 DEFB $66 ; 'f' 733E 69 DEFB $69 ; 'i' 733F 65 DEFB $65 ; 'e' 7340 6C DEFB $6C ; 'l' 7341 64 DEFB $64 ; 'd' 7342 00 DEFB $00 7343 20 DEFB $20 ; ' ' 7344 69 DEFB $69 ; 'i' 7345 6E DEFB $6E ; 'n' 7346 20 DEFB $20 ; ' ' 7347 64 DEFB $64 ; 'd' 7348 61 DEFB $61 ; 'a' 7349 74 DEFB $74 ; 't' 734A 61 DEFB $61 ; 'a' 734B 20 DEFB $20 ; ' ' 734C 66 DEFB $66 ; 'f' 734D 69 DEFB $69 ; 'i' 734E 65 DEFB $65 ; 'e' 734F 6C DEFB $6C ; 'l' 7350 64 DEFB $64 ; 'd' 7351 00 DEFB $00 7352 20 DEFB $20 ; ' ' 7353 77 DEFB $77 ; 'w' 7354 72 DEFB $72 ; 'r' 7355 6F DEFB $6F ; 'o' 7356 6E DEFB $6E ; 'n' 7357 67 DEFB $67 ; 'g' 7358 20 DEFB $20 ; ' ' 7359 74 DEFB $74 ; 't' 735A 72 DEFB $72 ; 'r' 735B 61 DEFB $61 ; 'a' 735C 63 DEFB $63 ; 'c' 735D 6B DEFB $6B ; 'k' 735E 00 DEFB $00 735F 20 DEFB $20 ; ' ' 7360 62 DEFB $62 ; 'b' 7361 61 DEFB $61 ; 'a' 7362 64 DEFB $64 ; 'd' 7363 20 DEFB $20 ; ' ' 7364 74 DEFB $74 ; 't' 7365 72 DEFB $72 ; 'r' 7366 61 DEFB $61 ; 'a' 7367 63 DEFB $63 ; 'c' 7368 6B DEFB $6B ; 'k' 7369 00 DEFB $00 736A 00 DEFB $00 736B 00 DEFB $00 736C 00 DEFB $00 736D 00 DEFB $00 736E 00 DEFB $00 736F 00 DEFB $00 7370 00 DEFB $00 7371 00 DEFB $00 7372 00 DEFB $00 7373 00 DEFB $00 7374 00 DEFB $00 7375 00 DEFB $00 7376 00 DEFB $00 7377 00 DEFB $00 7378 00 DEFB $00 7379 00 DEFB $00 737A 00 DEFB $00 737B 00 DEFB $00 737C 00 DEFB $00 737D 00 DEFB $00 737E 00 DEFB $00 737F 00 DEFB $00 7380 00 DEFB $00 7381 00 DEFB $00 7382 00 DEFB $00 7383 00 DEFB $00 7384 00 DEFB $00 7385 00 DEFB $00 7386 00 DEFB $00 7387 00 DEFB $00 7388 00 DEFB $00 7389 00 DEFB $00 738A 00 DEFB $00 738B 00 DEFB $00 738C 00 DEFB $00 738D 00 DEFB $00 738E 00 DEFB $00 738F 00 DEFB $00 7390 00 DEFB $00 7391 00 DEFB $00 7392 00 DEFB $00 7393 00 DEFB $00 7394 00 DEFB $00 7395 00 DEFB $00 7396 00 DEFB $00 7397 00 DEFB $00 7398 00 DEFB $00 7399 00 DEFB $00 739A 00 DEFB $00 739B 00 DEFB $00 739C 00 DEFB $00 739D 00 DEFB $00 739E 00 DEFB $00 739F 00 DEFB $00 73A0 00 DEFB $00 73A1 00 DEFB $00 73A2 00 DEFB $00 73A3 00 DEFB $00 73A4 00 DEFB $00 73A5 00 DEFB $00 73A6 00 DEFB $00 73A7 00 DEFB $00 73A8 00 DEFB $00 73A9 00 DEFB $00 73AA 00 DEFB $00 73AB 00 DEFB $00 73AC 00 DEFB $00 73AD 00 DEFB $00 73AE 00 DEFB $00 73AF 00 DEFB $00 73B0 00 DEFB $00 73B1 00 DEFB $00 73B2 00 DEFB $00 73B3 00 DEFB $00 73B4 00 DEFB $00 73B5 00 DEFB $00 73B6 00 DEFB $00 73B7 00 DEFB $00 73B8 00 DEFB $00 73B9 00 DEFB $00 73BA 00 DEFB $00 73BB 00 DEFB $00 73BC 00 DEFB $00 73BD 00 DEFB $00 73BE 00 DEFB $00 73BF 00 DEFB $00 73C0 00 DEFB $00 73C1 00 DEFB $00 73C2 00 DEFB $00 73C3 00 DEFB $00 73C4 00 DEFB $00 73C5 00 DEFB $00 73C6 00 DEFB $00 73C7 00 DEFB $00 73C8 00 DEFB $00 73C9 00 DEFB $00 73CA 00 DEFB $00 73CB 00 DEFB $00 73CC 00 DEFB $00 73CD 00 DEFB $00 73CE 00 DEFB $00 73CF 00 DEFB $00 73D0 00 DEFB $00 73D1 00 DEFB $00 73D2 00 DEFB $00 73D3 00 DEFB $00 73D4 00 DEFB $00 73D5 00 DEFB $00 73D6 00 DEFB $00 73D7 00 DEFB $00 73D8 00 DEFB $00 73D9 00 DEFB $00 73DA 00 DEFB $00 73DB 00 DEFB $00 73DC 00 DEFB $00 73DD 00 DEFB $00 73DE 00 DEFB $00 73DF 00 DEFB $00 73E0 00 DEFB $00 73E1 00 DEFB $00 73E2 00 DEFB $00 73E3 00 DEFB $00 73E4 00 DEFB $00 73E5 00 DEFB $00 73E6 00 DEFB $00 73E7 00 DEFB $00 73E8 00 DEFB $00 73E9 00 DEFB $00 73EA 00 DEFB $00 73EB 00 DEFB $00 73EC 00 DEFB $00 73ED 00 DEFB $00 73EE 00 DEFB $00 73EF 00 DEFB $00 73F0 00 DEFB $00 73F1 00 DEFB $00 73F2 00 DEFB $00 73F3 00 DEFB $00 73F4 00 DEFB $00 73F5 00 DEFB $00 73F6 00 DEFB $00 73F7 00 DEFB $00 73F8 00 DEFB $00 73F9 00 DEFB $00 73FA 00 DEFB $00 73FB 00 DEFB $00 73FC 00 DEFB $00 73FD 00 DEFB $00 73FE 00 DEFB $00 73FF 00 DEFB $00